package com.itheima.manager;

import com.itheima.common.R;
import com.itheima.domain.HomeRecommendSubject;
import com.itheima.service.IHomeRecommendSubjectService;
import com.itheima.vo.PageBeanVo;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

@Component
public class SmsHomeRecommendSubjectManager {

    @DubboReference
    IHomeRecommendSubjectService homeRecommendSubjectService;


    public R findByPage(Integer pageNum, Integer pageSize, String subjectName, Integer recommendStatus) {

        PageBeanVo byPage = homeRecommendSubjectService.findByPage(pageNum, pageSize, subjectName, recommendStatus);
        return R.success(byPage);

    }

    public R addNew(HomeRecommendSubject homeRecommendSubject) {
        homeRecommendSubjectService.addNew(homeRecommendSubject);
        return R.success(null);
    }

    public R delete(Integer[] ids) {
        homeRecommendSubjectService.delete(ids);
        return R.success(null);
    }

    public R update(Integer[] ids, Integer recommendStatus) {
        homeRecommendSubjectService.update(ids,recommendStatus);
        return R.success(null);
    }

    public R sort(Integer id, Integer sort) {
        homeRecommendSubjectService.sort(id,sort);
        return R.success(null);
    }
}
